package com.itheima.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/***
 * 描述
 * @author ljh
 * @packagename com.itheima.listener
 * @version 1.0
 * @date 2020/1/17
 */
@Component
@RabbitListener(queues ="queue.message")
public class MessageListener {

    @RabbitHandler
    public void msg(String msg){
        System.out.println(new Date());
        System.out.println(msg);
    }
}
